package com.atguigu.edusta.controller;


import com.atguigu.commonutils.R;
import com.atguigu.edusta.service.StatisticsDailyService;
import org.apache.catalina.core.StandardServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2022-08-24
 */
@RestController
@RequestMapping("/edusta/statistics")
//@CrossOrigin
public class StatisticsDailyController {

    @Autowired
    StatisticsDailyService statisticsDailyService;

    //创建日期
    @PostMapping("registerCount/{day}")
    public R registerCount(@PathVariable String day){
        statisticsDailyService.registerCount(day);
        return R.ok();
    }

    //获取对应日期的数据
    @GetMapping("getDateShow/{type}/{begin}/{end}")
    public R getDateShow(@PathVariable String type,@PathVariable String begin,@PathVariable String end){trftrdt
        Map<String,Object> map =statisticsDailyService.getDateShow(type,begin,end);jhasodfhajklsfddsal
        return R.ok().data(map);
    }

}

